import { Component } from 'react';
import { withRouter } from 'react-router';
import './PageAnalyse.less';
import Tabs from 'uxcore-tabs';
const TabPane = Tabs.TabPane;
import Jam from 'components/jam';
import Ontime from 'components/ontime';
import Interval from 'components/interval';
import Speed from 'components/speed';
import Transverse from 'components/transverse';
import Lease from 'components/lease';

export default withRouter(class Analyse extends Component {

  constructor(props) {
    super(props);
    this.state = {
      city: "杭州市"
    }
  }

  componentDidMount() {

  }

  componentWillUnmount() {

  }

  componentWillReceiveProps(nextProps) {
    let t = this;
    if (t.state.city != nextProps.city) t.setState({ city: nextProps.city });

  }

  render() {
    const { props: { city } } = this;
    return (
      <div className="page-analyse">
        <Tabs defaultActiveKey="1" type="open">
          <TabPane tab="公交拥堵率分析" key="1"><Jam /></TabPane>
          <TabPane tab="公交准点率分析" key="2"><Ontime /></TabPane>
          <TabPane tab="公交间隔率分析" key="3"><Interval /></TabPane>
          <TabPane tab="平均车速分析" key="4"><Speed/></TabPane>
          <TabPane tab="城市公交横向比较分析" key="5"><Transverse/></TabPane>
          <TabPane tab="公共自行车租赁统计" key="6">< Lease/></TabPane>
        </Tabs>
      </div>
    );
  }
});
